package com.easy.frame.servers.sys.mapper.type;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.easy.frame.servers.sys.entity.SysCategoryType;
import com.easy.frame.servers.sys.vo.SysCategoryTypeVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 类型分类表(5张表总表，根据type进行区分) Mapper 接口
 * </p>
 *
 * @author tp
 * @since 2021-01-03
 */
public interface SysCategoryTypeMapper extends BaseMapper<SysCategoryType> {

    List<SysCategoryType> getEquTypeTree(@Param("enabled") int enabled, @Param("type") String type);

    String selectMaxPath(@Param("parentPath") String parentPath, @Param("type") String type);

    int updateLeafNode(SysCategoryType temp);

    int updateByParentPath(SysCategoryType categoryType);

    int updateDelete(@Param("id") Long id);

    int countById(@Param("id") Long id);

    SysCategoryTypeVO selectParentEquById(@Param("parentEquId") Integer parentEquId, @Param("type") String type);

    Integer selectMaxSeq(@Param("parentPath") String parentPath, @Param("level") int level, @Param("type") String type);

    List<String> listByPath(@Param("list") List<String> list, @Param("type") String type);

    List<SysCategoryType> sysCategoryTypePath(@Param("list") List<String> list, @Param("type") String type);

    SysCategoryTypeVO selectVoById(@Param("id") Long id);
}
